<?php
global $_GPC, $_W;
// $action = 'ad';
// $title = $this->actions_titles[$action];
$GLOBALS['frames'] = $this->getMainMenu();
$op = !empty($_GPC['op']) ? $_GPC['op'] : 'display';
$item=pdo_getall('zh_gjw_marketrule',array('uniacid'=>$_W['uniacid']));
if($op=='delete'){
	$file=pdo_get('zh_gjw_marketrule',array('id'=>$_GPC['id']));
    $url=str_replace('https://','',$_W['attachurl_local']);
    unlink('/www/wwwroot/'.$url.$file['img']);
    $res=pdo_delete('zh_gjw_marketrule',array('id'=>$_GPC['id']));
    // var_dump($res);die;
    if($res){
      message('删除成功',$this->createWebUrl('marketrule',array()),'success');
    }else{
      message('删除失败','','error');
    }
}
include $this->template('web/marketrule');